﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HA.ModFlow.Domain.DomainLayer;
using System.Windows.Controls;
namespace HA.ModFlow.Application
{
    class IBoundMFViewModel:MDTVIViewModel
    {
        public IBoundMFViewModel(MDTVIViewModel parent, GridData grid)
            : base(parent, false)
        {

            this._contextMenu = new ContextMenu();
            MenuItem mi = new MenuItem();
            mi.Header = "属性";
            mi.Command = ModflowV2Commands.EditIbound;
            this._contextMenu.Items.Add(mi);
            this._imageSource = VMImageSource.dataset;
            this._isShowCheck = false;
            this._gridData = grid;
        }

        GridData _gridData;

        public override string Desc
        {
            get
            {
                return "IBOUND边界";
            }
        }

        public override System.Windows.Input.ICommand DoubleClickCommand
        {
            get
            {
                return ModflowV2Commands.EditIbound;
            }
        }


        protected override void OnSelectedChanged()
        {
            if (this.IsSelected)
            {
                if (ProjectService.DefaultService.Project.CurentFlowVectorData != null)
                {
                    ProjectService.DefaultService.Project.CurentFlowVectorData = null;
                }
                if (ProjectService.DefaultService.Project.CurrentDSGrid != null)
                {
                    ProjectService.DefaultService.Project.CurrentDSGrid = null;
                }

                ProjectService.DefaultService.Project.CurrentDSData = this._gridData.GetIBoundDs();
                UIModule.DefaultModule.RibbonV2ViewModel.ViewOpViewModel.ToolVM.CurrentTool = APPTOOLMODE.GRID3D;
            }
        }
    }
}
